package role

import (
	"context"
	"kstar-gf-api/internal/dao"
	"kstar-gf-api/internal/model/entity"
	"kstar-gf-api/internal/service"
)

type sTenant struct{}

func init() {
	service.RegisterTenant(New())
}

func New() *sTenant {
	return &sTenant{}
}

// 获取租户信息
func (s *sTenant) GetTenantInfo(ctx context.Context, tenantId string) (info *entity.SysTenant, err error) {
	err = dao.SysTenant.Ctx(ctx).Where(dao.SysTenant.Columns().TenantId, tenantId).Scan(&info)

	return
}
